home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / ediff.info-1 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  46.9 KB  |  1,044 lines

  1. This is Info file ../info/ediff.info, produced by Makeinfo-1.63 from
  2. the input file ediff.texi.
  3.  
  4.    This file documents Ediff, a comprehensive visual interface to Unix
  5. `diff' and `patch' utilities.
  6.  
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.  
  11. 
  12. File: ediff.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
  13.  
  14. * Menu:
  15.  
  16. * Introduction::                About Ediff.
  17. * Major Entry Points::          How to use Ediff.
  18. * Commands::                    Ediff commands.
  19. * Registry of Ediff Sessions::  Keeping track of multiple Ediff sessions.
  20. * Session Groups::              Comparing and merging directories.
  21. * Remote and Compressed Files::  You may want to know about this.
  22. * Customization::               How to make Ediff work the way YOU want.
  23. * Credits::                     Thanks to those who helped.
  24. * Index::
  25.  
  26. 
  27. File: ediff.info,  Node: Introduction,  Next: Major Entry Points,  Prev: Top,  Up: Top
  28.  
  29. Introduction
  30. ************
  31.  
  32.    Ediff provides a convenient way for merging and comparing pairs (or
  33. triples) of files and buffers.  The files being compared, file-A,
  34. file-B, and file-C (if applicable) are shown in separate windows (side
  35. by side, one above the another, or in separate frames), and the
  36. differences are highlighted as you step through them.  You can also
  37. copy difference regions from one buffer to another (and recover old
  38. differences if you change your mind).
  39.  
  40.    Another powerful feature is the ability to merge a pair of files
  41. into a third buffer. Merging with an ancestor file is also supported.
  42. Furthermore, Ediff is equipped with directory-level capabilities that
  43. allow the user to conveniently launch browsing or merging sessions on
  44. groups of files in two (or three) different directories.
  45.  
  46.    In addition, Ediff can apply a patch to a file and then let you step
  47. though both files, the patched and the original one, simultaneously,
  48. difference-by-difference.  You can even apply a patch right out of a
  49. mail buffer, i.e., patches received by mail don't even have to be
  50. saved.  Since Ediff lets you copy differences between buffers, you can,
  51. in effect, apply patches selectively (i.e., you can copy a difference
  52. region from `file_orig' to `file', thereby undoing any particular patch
  53. that you don't like).
  54.  
  55.    Unfortunately, Ediff still doesn't understand multi-file
  56. patches--this requires further work (volunteers needed!).
  57.  
  58.    Ediff is aware of version control, which lets the user compare files
  59. with their older versions. Ediff also works with remote and compressed
  60. files, automatically ftp-ing them over and uncompressing them.  *Note
  61. Remote and Compressed Files::, for details.
  62.  
  63.    This package builds upon ideas borrowed from `emerge.el' and several
  64. Ediff's routines are adaptations from that package.  Although Ediff
  65. subsumes `emerge.el' in its functionality, much of that functionality
  66. of Ediff is influenced by `emerge.el'.  The implementation and the
  67. interface are, of course, drastically different.
  68.  
  69. 
  70. File: ediff.info,  Node: Major Entry Points,  Next: Commands,  Prev: Introduction,  Up: Top
  71.  
  72. Major Entry Points
  73. ******************
  74.  
  75.    Ediff can be invoked interactively using the following functions,
  76. which can be run either from the minibuffer or from the menu bar. In
  77. the menu bar, all Ediff's entry points belong to three submenus of the
  78. `Tools' menu: `Compare,' `Merge,' and `Apply Patch.' You don't have to
  79. remember these entry points, if Ediff is invoked via the menu bar.
  80.  
  81. `ediff-files'
  82. `ediff'
  83.      Compare two files.
  84.  
  85. `ediff-buffers'
  86.      Compare two buffers.
  87.  
  88. `ediff-files3'
  89. `ediff3'
  90.      Compare three files.
  91.  
  92. `ediff-buffers3'
  93.      Compare three buffers.
  94.  
  95. `ediff-directories'
  96. `edirs'
  97.      Compare files common to two directories.
  98.  
  99. `ediff-directories3'
  100. `edirs3'
  101.      Compare files common to three directories.
  102.  
  103. `ediff-directory-revisions'
  104. `edir-revisions'
  105.      Compare versions of files in a given directory. Ediff selects only
  106.      the files that are under version control.
  107.  
  108. `ediff-merge-directory-revisions'
  109. `edir-merge-revisions'
  110.      Merge versions of files in a given directory. Ediff selects only
  111.      the files that are under version control.
  112.  
  113. `ediff-merge-directory-revisions-with-ancestor'
  114. `edir-merge-revisions-with-ancestor'
  115.      Merge versions of files in a given directory using other versions
  116.      as ancestors. Ediff selects only the files that are under version
  117.      control.
  118.  
  119. `ediff-windows-wordwise'
  120.      Compare windows word-by-word.
  121.  
  122. `ediff-windows-linewise'
  123.      Compare windows line-by-line.
  124.  
  125. `ediff-regions-wordwise'
  126.      Compare regions word-by-word.
  127.  
  128. `ediff-regions-linewise'
  129.      Compare regions line-by-line.
  130.  
  131. `ediff-revision'
  132.      Compare versions of current buffer, if the buffer is visiting  a
  133.      file under version control.
  134.  
  135. `ediff-patch-file'
  136. `epatch'
  137.      Patch file then compare. At present, doesn't understand multi-file
  138.      patches.
  139.  
  140. `ediff-patch-buffer'
  141. `epatch-buffer'
  142.      Patch buffer then compare.
  143.  
  144. `ediff-merge-files'
  145. `ediff-merge'
  146.      Merge two files.
  147.  
  148. `ediff-merge-files-with-ancestor'
  149. `ediff-merge-with-ancestor'
  150.      Same but with ancestor.
  151.  
  152. `ediff-merge-buffers'
  153.      Merge two buffers.
  154.  
  155. `ediff-merge-buffers-with-ancestor'
  156.      Same but with ancestor.
  157.  
  158. `ediff-merge-directories'
  159. `edirs-merge'
  160.      Merge files common to two directories.
  161.  
  162. `ediff-merge-directories-with-ancestor'
  163. `edirs-merge-with-ancestor'
  164.      Same but using files in a third directory as ancestors.
  165.  
  166. `ediff-merge-revisions'
  167.      Merge two versions of the file visited by the current buffer.
  168.      Same but with ancestor.
  169.  
  170. If you want Ediff to be loaded from the very beginning, you should have
  171.      (require 'ediff)
  172.  
  173. in your .emacs file. Otherwise, Ediff will be loaded automatically when
  174. you use one of the above functions, either directly or through the
  175. menus.
  176.  
  177.    When the above functions are invoked, they prompt the user about the
  178. information they need--typically the files or buffers to compare or
  179. patch. Ediff tries to be smart about these prompts. For instance, in
  180. comparing/merging files, it will offer the visible buffers as defaults.
  181. In prompting for files, if the user enters a directory, the previously
  182. input file name will be appended to that directory. In addition, if the
  183. variable `ediff-use-last-dir' is not `nil', Ediff will offer previously
  184. entered directories as defaults (which will be maintained separately
  185. for each type of file, A, B, or C).
  186.  
  187.    All the above functions use the Unix `diff' utility to find
  188. difference regions. They process `diff' output and display it to the
  189. user in a convenient form. At present, Ediff understands only the plain
  190. output from diff. Options such as `-c' are not supported, nor is the
  191. format produced by VMS diff.
  192.  
  193.    The functions `ediff-files', `ediff-buffers', `ediff-files3',
  194. `ediff-buffers3' first display the coarse, line-based difference
  195. regions, as reported by the `diff' program.  Since `diff' may report
  196. fairly large chunks of text as being different, even though the
  197. difference may be localized to just a few words or even to the white
  198. space or line breaks, Ediff will further *refine* the regions to
  199. indicate which exact words differ. If the only difference is in the
  200. white space and line breaks, Ediff will say so.  On a color display,
  201. fine differences are highlighted with color; on a monochrome display,
  202. they are underlined. *Note Highlighting Difference Regions::, to learn
  203. how to change that.
  204.  
  205.    The functions `ediff-windows-wordwise', `ediff-windows-line-wise',
  206. `ediff-regions-wordwise' and `ediff-regions-linewise' do comparison on
  207. parts of buffers (which must already exist).  Since
  208. `ediff-windows-wordwise'  and `ediff-regions-wordwise' are intended for
  209. relatively small segments of buffers, comparison is done on the basis
  210. of words rather than lines. No refinement is necessary in this case.
  211. This technique is effective only for relatively small regions (perhaps,
  212. up to 100 lines), as these functions have a relatively slow startup.
  213.  
  214.    To compare large regions, use ediff-regions-linewise. In this mode,
  215. Ediff displays differences as it would if invoked via `ediff-files' or
  216. `ediff-buffers.'
  217.  
  218.    The functions `ediff-patch-file' and `ediff-patch-buffer' apply a
  219. patch to a file or a buffer and then run Ediff on these buffers,
  220. displaying the difference regions. Currently, Ediff still doesn't
  221. understand multi-file patches (volunteers?).
  222.  
  223.    The entry points `ediff-directories', `ediff-merge-directories',
  224. etc., provide a convenient interface for comparing and merging files in
  225. different directories. The user is presented with Dired-like interface
  226. from which one can run a group of related Ediff sessions.
  227.  
  228.    Finally, for files under version control, `ediff-revision' lets the
  229. user compare versions of the file visited by the current buffer.
  230. Moreover, the functions `ediff-directory-revisions',
  231. `ediff-merge-directory-revisions', etc., let the user run a group of
  232. related Ediff sessions by taking a directory and comparing (or merging)
  233. versions of files in that directory (for files that are under version
  234. control).
  235.  
  236. 
  237. File: ediff.info,  Node: Commands,  Next: Registry of Ediff Sessions,  Prev: Major Entry Points,  Up: Top
  238.  
  239. Commands
  240. ********
  241.  
  242.    All Ediff commands pertinent to a given session are displayed in a
  243. quick help window, unless you type `?' to shrink the window to just one
  244. line.  You can redisplay the help window by hitting `?' again.  In this
  245. section we comment only on the features that cannot be readily deduced
  246. from the quick help window.  You can always type `E' in any control
  247. window to bring up this manual.
  248.  
  249.    Many Ediff commands take numeric prefix arguments.  For instance, if
  250. you type a number, say 3, and then `j' (ediff-jump-to-difference), Ediff
  251. will take you to the 3d difference region.  Typing 3 and then `a'
  252. (`ediff-diff-to-diff') will copy the 3d difference region from buffer A
  253. to buffer B.  Hitting `b' does copying in the opposite direction. (In
  254. 3-way comparison mode, the commands for copying are `ab', `ba', `ca',
  255. etc.) Likewise, 4 followed by `ra' will restore the 4th difference
  256. region in buffer A (if it was previously saved as a result of copying
  257. from, say, buffer B to A).
  258.  
  259.    Without the prefix argument, all commands operate on the current
  260. difference region.
  261.  
  262.    The total number of differences and the current difference number are
  263. always displayed in the mode line of the control window.
  264.  
  265.    If, after making changes to buffers A, B, or C, you decide to save
  266. them, it is recommended to use `ediff-save-buffer', which is bound to
  267. `wa', `wb', and `wc' (`wa' will save buffer A, `wb' saves buffer B,
  268. etc.).
  269.  
  270.    Typing `wd' saves the output from the `diff' utility to a file, so
  271. you can later refer to it. With prefix argument, this command saves the
  272. plain output from `diff' (see `ediff-diff-program' and
  273. `ediff-diff-options'). Without the argument, it saves customized `diff'
  274. output (see `ediff-custom-diff-program' and
  275. `ediff-custom-diff-options'), if it is available.
  276.  
  277.    Instead of saving it, `diff' output can be *displayed* using the
  278. command `D'. Without the prefix argument, it displays the customized
  279. `diff' output of the session.  With the prefix argument, it displays
  280. the plain `diff' output If either of the `diff' outputs is unavailable
  281. (because it wasn't generated or the user killed the respective buffer),
  282. then Ediff will try to display the other `diff' output.  If none is
  283. available, a warning is issued.
  284.  
  285.    The command `z' suspends the current ediff session. It hides the
  286. control buffer and the variants. The easiest way to resume a suspended
  287. Ediff session is through the registry of active sessions.  *Note
  288. Registry of Ediff Sessions::, for details.
  289.  
  290.    The command `q' quits the current Ediff session. With a prefix
  291. argument, it will ask the user whether to delete the variant buffers.
  292.  
  293.    The command `s' is used only for merging. It allows the user to
  294. shrink window C to its minimal size, thereby exposing as much of
  295. buffers A and B as possible.  This command is intended only for
  296. temporary viewing. Therefore, Ediff will restore the original window
  297. size for buffer C whenever window configuration is changed by the user
  298. (on toggling the help, changing the manner in which windows are split,
  299. etc.). However, recentering and jumping to a difference does not affect
  300. window C. Typing `s' again restores the original size of the merge
  301. window.
  302.  
  303.    With a positive prefix argument, the command `s' makes the merge
  304. window, window C, slightly taller. With `-' or a negative prefix
  305. argument, `s' makes window C slightly shorter.
  306.  
  307.    In the merge mode, Ediff uses a default variant (one of the two
  308. files being merged) when it cannot decide which of the difference
  309. regions (that of buffer A or buffer B) should be copied into the merge
  310. buffer.  A user may decide that the default variant was chosen
  311. inappropriately and may wish to change that while merging is in
  312. progress.  To facilitate this, Ediff has a command, bound to `&', which
  313. will cause Ediff to start merging anew beginning with the current
  314. difference, using an alternative default variant (the user is asked to
  315. type in the new default for merging), which can be either `default-A',
  316. `default-B', or `combined'.  *Note Merging and diff3::, for details.
  317.  
  318.    Such repeated merging affects only difference regions that have
  319. default-A/B status, and only if they were not changed with respect to
  320. their originals.
  321.  
  322.    Another command that is used only for merging is `+'. Its effect is
  323. to combine the current difference regions of buffers A and B and put the
  324. combination into the merge buffer. *Note Merging and diff3::,
  325. specifically, the variables `ediff-combine-diffs' and
  326. `ediff-combination-pattern'.
  327.  
  328.    Some commands are not bound to any key:
  329. `ediff-show-registry'
  330. `eregistry'
  331.      This command brings up the registry of active Ediff sessions.
  332.      Ediff registry is a useful device that can be used for resuming
  333.      Ediff sessions when the user switched to some other work before
  334.      finishing a comparison or merging job.  It is also useful for
  335.      switching between multiple active Ediff sessions that are run at
  336.      the same time. The function `eregistry' is an alias for
  337.      `ediff-show-registry'.
  338.  
  339. `ediff-toggle-multiframe'
  340.      Changes the display from the multi-frame mode (where the quick
  341.      help window is in a separate frame) to the single-frame mode
  342.      (where all Ediff buffers share the same frame), and vice versa.
  343.  
  344. `ediff-revert-buffers-then-recompute-diffs'
  345.      This is useful when, after making changes, you decided to make a
  346.      fresh start, or if at some point you changed the files being
  347.      compared but want to discard any changes to comparison buffers
  348.      that were done since then.  This command will ask for confirmation
  349.      before reverting files. With a prefix argument, it will revert
  350.      files without asking.
  351.  
  352. `ediff-profile'
  353.      Ediff has an admittedly primitive (but useful) facility for
  354.      profiling Ediff's commands. Users should not be concerned with this
  355.      feature, unless they are willing to put time into improving the
  356.      efficiency of Ediff. The function `ediff-profile' toggles
  357.      profiling of ediff commands.
  358.  
  359. 
  360. File: ediff.info,  Node: Registry of Ediff Sessions,  Next: Session Groups,  Prev: Commands,  Up: Top
  361.  
  362. Registry of Ediff Sessions
  363. **************************
  364.  
  365.    Ediff maintains a registry of all its invocations that are still
  366. *active*. This feature is very convenient for switching among active
  367. Ediff sessions or for quickly restarting a suspended Ediff session.
  368.  
  369.    The focal point of this activity is a buffer called **Ediff
  370. Registry**. You can display this buffer by typing `R' in any Ediff
  371. Control Buffer or Session Group Buffer (*note Session Groups::.), or by
  372. typing `M-x eregistry' into the Minibuffer.  The latter would be the
  373. fastest way to bring up the registry buffer if no control or group
  374. buffer is displayed in any of the visible Emacs windows.  If you are in
  375. a habit of running multiple long Ediff sessions and often need to
  376. suspend, resume, or switch between them, it may be a good idea to have
  377. the registry buffer permanently displayed in a separate, dedicated
  378. window.
  379.  
  380.    The registry buffer has several convenient key bindings.  For
  381. instance, clicking mouse button 2 or typing `RET' or `v' over any
  382. session record resumes that session.  Session records in the registry
  383. buffer provide a fairly complete description of each session, so it is
  384. usually easy to identify the right session to resume.
  385.  
  386.    Other useful commands are bound to `SPC' (next registry record) and
  387. `DEL' (previous registry record). There are other commands as well, but
  388. you don't need to memorize them, since they are listed at the top of
  389. the registry buffer.
  390.  
  391. 
  392. File: ediff.info,  Node: Session Groups,  Next: Remote and Compressed Files,  Prev: Registry of Ediff Sessions,  Up: Top
  393.  
  394. Session Groups
  395. **************
  396.  
  397.    Several major entries of Ediff perform comparison and merging on
  398. directories.  On entering `ediff-directories', `ediff-directories3',
  399. `ediff-merge-directories', `ediff-merge-directories-with-ancestor',
  400. `ediff-directory-revisions', `ediff-merge-directory-revisions', or
  401. `ediff-merge-directory-revisions-with-ancestor', the user is presented
  402. with a Dired-like buffer that lists files common to the directories
  403. involved along with their sizes. (The list of common files can be
  404. further filtered through a regular expression, which the user is
  405. prompted for.) We call this buffer *Session Group Panel* because all
  406. Ediff sessions associated with the listed files will have this buffer
  407. as a common focal point.
  408.  
  409.    Clicking button 2 or typing `RET' or `v' over a record describing
  410. files invokes Ediff in the appropriate mode on these files. You can
  411. come back to the session group buffer associated with a particular
  412. invocation of Ediff by typing `M' in Ediff control buffer of that
  413. invocation.
  414.  
  415.    Many commands are available in the session group buffer; some are
  416. applicable only for certain types of work. The relevant commands are
  417. always listed at the top of each session group buffer, so there is no
  418. need to memorize them.
  419.  
  420.    In directory comparison or merging, a session group panel displays
  421. only the files common to all directories involved. The differences are
  422. kept in a separate buffer and are conveniently displayed by typing `D'
  423. to the corresponding session group panel. Thus, as an added benefit,
  424. Ediff can be used to compare the contents of up to three directories.
  425.  
  426.    Session records in session group panels are also marked with `+', for
  427. active sessions, and with `-', for finished sessions.
  428.  
  429.    Sometimes, it is convenient to exclude certain session records from
  430. a group.  Usually this happens when the user doesn't intend to run
  431. Ediff of certain files in the group, and the corresponding session
  432. records just add clutter to the session group buffer. To help alleviate
  433. this problem, the user can type `x' to mark a session as a candidate
  434. for exclusion and `x' to actually hide the marked sessions. There
  435. actions are reversible: with a prefix argument, `h' unmarks the session
  436. under the cursor, and `x' brings the hidden sessions into the view (`x'
  437. doesn't unmark them, though, so the user has to explicitly unmark the
  438. sessions of interest).
  439.  
  440.    Group sessions also understand the command `m', which marks sessions
  441. for future operations (other than hiding) on a group of sessions. At
  442. present, the only such group-level operation is the creation of a
  443. multi-file patch.
  444.  
  445.    A multi-file patch is a concatenated output of several runs of the
  446. Unix `diff' command (some versions of `diff' let you create a
  447. multi-file patch in just one run).  In a session group buffer created in
  448. response to `ediff-directories' or `ediff-directory-revisions', the
  449. user can type `P' to create a multi-file patch of marked sessions
  450. (which must be marked using the `m' command).  Ediff then will display
  451. a buffer containing the patch.  In an `ediff-directories' session, it
  452. is enough to just mark the requisite sessions. In
  453. `ediff-directory-revisions' revisions, the marked sessions must also be
  454. active, or else Ediff will refuse to produce a multi-file patch. This is
  455. because, in the latter-style sessions, there are many ways to create
  456. diff output, and it is easier to handle by running Ediff on the inactive
  457. sessions.
  458.  
  459. 
  460. File: ediff.info,  Node: Remote and Compressed Files,  Next: Customization,  Prev: Session Groups,  Up: Top
  461.  
  462. Remote and Compressed Files
  463. ***************************
  464.  
  465.    Ediff works with remote, compressed, and encrypted files. Ediff
  466. supports ange-ftp.el, jka-compr.el, uncompress.el and crypt++.el, but
  467. it may work with other similar packages as well. This means that you
  468. can compare files residing on another machine, or you can apply a patch
  469. to a file on another machine (even the patch itself can be a remote
  470. file!).
  471.  
  472.    When patching compressed or remote files, Ediff does not rename the
  473. source file (unlike what the `patch' utility would usually do).
  474. Instead, the source file retains its name and the result of applying
  475. the patch is placed in a temporary file that has the suffix `_patched'
  476. attached.  Generally, this applies to files that are handled using
  477. black magic, such as special file handlers (ange-ftp and some
  478. compression and encryption packages all use this method).
  479.  
  480.    Regular files are treated by the `patch' utility in the usual manner,
  481. i.e., the original is renamed into `source-name_orig' and the result of
  482. the patch is placed into the file source-name. (Ediff uses `_orig'
  483. instead of the usual `.orig' to placate systems like VMS.)
  484.  
  485. 
  486. File: ediff.info,  Node: Customization,  Next: Credits,  Prev: Remote and Compressed Files,  Up: Top
  487.  
  488. Customization
  489. *************
  490.  
  491.    Ediff has a rather self-explanatory interface, and in most cases the
  492. user won't need to change anything. However, should the need arise,
  493. there are extensive facilities to change the default behavior.
  494.  
  495.    Most of the customization can be done by setting various variables
  496. in the `.emacs' file. Some customization (mostly window-related
  497. customization and faces) can be done by putting appropriate lines in
  498. `.Xdefaults', `.xrdb', or whatever X resource file is in use.
  499.  
  500.    With respect to the latter, it is important to be aware that the X
  501. resource for Ediff customization is `Ediff', *not* `emacs'.  *Note
  502. Window and Frame Configuration::, *Note Highlighting Difference
  503. Regions::, for further details. Please also refer to Emacs manual for
  504. the information on how to set Emacs X resources.
  505.  
  506. * Menu:
  507.  
  508. * Hooks::                       Customization via the hooks.
  509. * Quick Help::                  How to customize Ediff's quick help feature.
  510. * Window and Frame Configuration::  Controling the way Ediff displays things.
  511. * Selective Browsing::          Advanced browsing through difference regions.
  512. * Highlighting Difference Regions::  Control over highlighting.
  513. * Narrowing::                   Comparing regions, windows, etc.
  514. * Refinement of Difference Regions::  How to control the refinement process.
  515. * Patch and Diff Programs::     Changing the utilities that compute differences
  516.                                 and apply patches.
  517. * Merging and diff3::           How to customize Ediff in its Merge Mode.
  518. * Support for Version Control::  Changing the version control package.
  519.                           You are not likely to do that.
  520. * Customizing the Mode Line::   Changing the look of the mode line in Ediff.
  521. * Miscellaneous::               Other customization.
  522. * Notes on Heavy-duty Customization::  Customization for the gurus.
  523.  
  524. 
  525. File: ediff.info,  Node: Hooks,  Next: Quick Help,  Prev: Customization,  Up: Customization
  526.  
  527. Hooks
  528. =====
  529.  
  530.    The bulk of customization can be done via the following hooks:
  531. `ediff-load-hooks'
  532.      Can be used to change defaults after Ediff is loaded.  These hooks
  533.      are executed right after the default bindings are set.
  534.  
  535. `ediff-keymap-setup-hooks'
  536.      Can be used to alter bindings in Ediff's keymap. These hooks are
  537.      called right after the default bindings are set.
  538.  
  539. `ediff-before-setup-windows-hooks'
  540. `ediff-after-setup-windows-hooks'
  541.      Called before/after Ediff sets up its window configuration. Can be
  542.      used to save the configuration that existed before Ediff starts or
  543.      for whatever other purposes.
  544.  
  545. `ediff-suspend-hooks'
  546. `ediff-quit-hooks'
  547.      Can be used to set desired window configurations, delete files
  548.      Ediff didn't want to clean up after exiting, etc.  By default,
  549.      `ediff-quit-hooks' is set to a function, `ediff-cleanup-mess',
  550.      which cleans after Ediff, as appropriate in most cases. It is
  551.      rather unlikely that the user will want to change it. However, the
  552.      user may want add other hooks to `ediff-quit-hooks', either before
  553.      or after `ediff-cleanup-mess' (see the documentation for
  554.      `add-hook' in Emacs manual on how to do this).  One should be
  555.      aware that hooks executing before `ediff-cleanup-mess' start in
  556.      `ediff-control-buffer;' they should also leave
  557.      `ediff-control-buffer' as the current buffer when they finish.
  558.      Hooks that are executed after `ediff-cleanup-mess' should expect
  559.      the current buffer be either buffer A or buffer B.
  560.      `ediff-cleanup-mess' doesn't kill the buffers being compared or
  561.      merged (see `ediff-cleanup-hooks', below).
  562.  
  563. `ediff-cleanup-hooks'
  564.      Default is `nil'.  Hooks to run just before running
  565.      `ediff-quit-hooks'.  This is a good place to do various cleanups,
  566.      such as deleting the variant buffers.  Ediff provides a function,
  567.      `ediff-janitor', as one such possible hook, which the user can
  568.      `add-hooks' to `ediff-cleanup-hooks'.  This function kills buffers
  569.      A, B, and, possibly, C, if these buffers aren't modified. In merge
  570.      jobs, buffer C is never deleted.  However, the side effect of
  571.      using this function is that you may not be able to compare the
  572.      same buffer in two separate Ediff sessions: quitting one of them
  573.      will delete this buffer in another session as well.
  574.  
  575. `ediff-before-setup-control-frame-hooks'
  576. `ediff-after-setup-control-frame-hooks'
  577.      Can be used to relocate Ediff control frame when Ediff runs in a
  578.      multiframe mode (i.e., when the control buffer is in its own
  579.      dedicated frame).  Be aware that many variables that drive Ediff
  580.      are local to Ediff Control Panel (`ediff-control-buffer'), which
  581.      requires special care in writing these hooks.  Take a look at
  582.      `ediff-default-suspend-hook' and `ediff-default-quit-hook' to see
  583.      what's involved.
  584.  
  585. `ediff-startup-hooks'
  586.      Last hook called after Ediff starts up.
  587.  
  588. `ediff-select-hooks'
  589.      Called after Ediff selects the next difference region.
  590.  
  591. `ediff-unselect-hooks'
  592.      Called after Ediff unselects the current difference region.
  593.  
  594. `ediff-prepare-buffer-hooks'
  595.      Hooks executed for each Ediff buffer (A, B, C) right after these
  596.      buffers are arranged.
  597.  
  598. `ediff-display-help-hooks'
  599.      Ediff executes these hooks each time after setting up the help
  600.      message.  Can be used to alter the help message for custom
  601.      packages that run on top of Ediff.
  602.  
  603. `ediff-mode-hooks'
  604.      Called just after Ediff mode is set up in the control buffer. This
  605.      is done before any Ediff window is created. One can use it to set
  606.      local variables that alter the look of the display.
  607.  
  608. `ediff-registry-setup-hooks'
  609.      Hooks run after setting up the registry for all active Ediff
  610.      session.  *Note Session Groups::, for details.
  611.  
  612. `ediff-session-group-setup-hooks'
  613.      Hooks run after setting up a control panel for a group of related
  614.      Ediff sessions. *Note Session Groups::, for details.
  615.  
  616. 
  617. File: ediff.info,  Node: Quick Help,  Next: Window and Frame Configuration,  Prev: Hooks,  Up: Customization
  618.  
  619. Quick Help
  620. ==========
  621.  
  622.    Ediff provides quick help using its control panel window. Since this
  623. window takes a fair share of the screen real estate, you can toggle it
  624. off by hitting `?'. The control window will then shrink to just one
  625. line and a mode line, displaying a short help message. The variable
  626. `ediff-prefer-long-help-message' tells Ediff whether the user wants the
  627. short message initially or the long one. By default, it is set to
  628. `nil', meaning that the short message will be shown on startup. Set
  629. this to `t', if you want Ediff to start with the long message.  If you
  630. want to change the appearance of the help message on a per-buffer basis,
  631. you must use `ediff-startup-hooks' to change the value of the variable
  632. `ediff-help-message', which is local to `ediff-control-buffer'.
  633.  
  634. 
  635. File: ediff.info,  Node: Window and Frame Configuration,  Next: Selective Browsing,  Prev: Quick Help,  Up: Customization
  636.  
  637. Window and Frame Configuration
  638. ==============================
  639.  
  640.    On a non-windowing display, Ediff sets things up in one frame,
  641. splitting it between a small control window and the windows for buffers
  642. A, B, and C.  The split between these windows can be horizontal or
  643. vertical, which can be changed interactively by typing `|' while the
  644. cursor is in the control window.
  645.  
  646.    On a window display, Ediff sets up a dedicated frame for Ediff
  647. Control Panel and then it chooses windows as follows: If one of the
  648. buffers is invisible, it is displayed in the currently selected frame.
  649. If a buffer is visible, it is displayed in the frame where it is
  650. visible.  If, according to the above criteria, the two buffers fall
  651. into the same frame, then so be it--the frame will be shared by the
  652. two.  The same algorithm works when you hit `C-l' (`ediff-recenter'),
  653. `p' (`ediff-previous-difference'), `n' (`ediff-next-difference'), etc.
  654.  
  655.    The above behavior also depends on whether the current frame is
  656. splittable, dedicated, etc. Unfortunately, the margin is too small to
  657. present this remarkable algorithm.
  658.  
  659.    The bottom line of all this is that you can compare buffers in one
  660. frame or in different frames.  The former is done by default, while the
  661. latter can be achieved by arranging buffers A, B (and C, if applicable)
  662. to be seen in different frames.  Ediff respects these arrangements,
  663. automatically adapting itself to the multi-frame mode.
  664.  
  665.    Ediff uses the following variables to set up its control panel
  666. (a.k.a. control buffer, a.k.a. quick help window):
  667. `ediff-control-frame-parameters'
  668.      The user can change or augment this variable including the font,
  669.      color, etc. The X resource name of Ediff Control Panel frames is
  670.      `Ediff'. Under X-windows, you can use this name to set up
  671.      preferences in your `~/.Xdefaults', `~/.xrdb', or whatever X
  672.      resource file is in use. Usually this is preferable to changing
  673.      `ediff-control-frame-parameters' directly.  For instance, you can
  674.      specify in `~/.Xdefaults' where the control frame is to be sitting
  675.      on the screen using the resource `Ediff*geometry'.
  676.  
  677.      In general, any X resource pertaining the control frame can be
  678.      reached via the prefix `Ediff*'.
  679.  
  680. `ediff-control-frame-position-function'
  681.      The prefered way of specifying the position of the control frame
  682.      is by setting the variable `ediff-control-frame-position-function'
  683.      to an appropriate function.  The default value of this variable is
  684.      `ediff-make-frame-position'. This function places the control
  685.      frame in the vicinity of the North-East corner of the frame
  686.      displaying buffer A.
  687.  
  688.    The following variables can be used to adjust the location produced
  689. by `ediff-make-frame-position' and for related customization.
  690. `ediff-narrow-control-frame-leftward-shift'
  691.      Specifies the number of characters for shifting the control frame
  692.      from the rightmost edge of frame A when the control frame is
  693.      displayed as a small window.
  694.  
  695. `ediff-wide-control-frame-rightward-shift'
  696.      Specifies the rightward shift of the control frame from the left
  697.      edge of frame A when the control frame shows the full menu of
  698.      options.
  699.  
  700. `ediff-control-frame-upward-shift'
  701.      Specifies the number of pixels for the upward shift of the control
  702.      frame.
  703.  
  704. `ediff-prefer-iconified-control-frame'
  705.      If t, the control frame becomes iconified automatically when the
  706.      quick help message is toggled off. This saves valuable real estate
  707.      on the screen. Toggling help back will deiconify the control frame.
  708.  
  709.      To start Ediff with an iconified Control Panel, you should set this
  710.      variable to t and `ediff-prefer-long-help-message' to nil.  This
  711.      behavior is useful only in Emacs (not in XEmacs) and only if the
  712.      window manager is TWM or a derivative.
  713.  
  714.    If you truly and absolutely dislike the way Ediff sets up windows
  715. and if you cannot change this via frame parameters, the last resort is
  716. to rewrite the function `ediff-setup-windows'.  However, we believe that
  717. detaching Ediff Control Panel from the rest and making it into a
  718. separate frame offers an important opportunity by allowing you to
  719. iconify that frame. Under Emacs, the icon will usually accept all of the
  720. Ediff commands, but will free up valuable real estate on your screen
  721. (this may depend on the window manager, though). Iconifying won't do any
  722. good under XEmacs since XEmacs icons are not sensitive to keyboard
  723. input.  The saving grace is that, even if not iconified, the control
  724. frame is very small, smaller than some icons, so it does not take much
  725. space in any case.
  726.  
  727.    The following  variable controls how windows are set up.
  728. `ediff-window-setup-function'
  729.      The multiframe setup is achieved via
  730.      `ediff-setup-windows-multiframe' function, which is a default on
  731.      windowing displays.  The plain setup, one where all windows are
  732.      always in one frame, is done via `ediff-setup-windows-plain',
  733.      which is the default on a non-windowing display (or in an xterm
  734.      window).  In fact, under Emacs, you can switch freely between
  735.      these two setups by executing the command
  736.      `ediff-toggle-multiframe' using the Minibuffer.
  737.  
  738.      If you don't like any of these setups, write your own function. See
  739.      the documentation for `ediff-window-setup-function' for the basic
  740.      guidelines. However, writing window setups is not easy, so before
  741.      embarking on this job you may want to take a close look at
  742.      `ediff-setup-windows-plain' and `ediff-setup-windows-multiframe'.
  743.  
  744.    The user can run multiple Ediff sessions at once, by invoking Ediff
  745. several times without exiting previous Ediff sessions. Different
  746. sessions may even operate on the same pair of files.  Each session
  747. would have its own Ediff Control Panel and all the regarding a
  748. particular session is local to the associated control panel buffer.
  749. You can switch between sessions by suspending one session and then
  750. switching to another control panel. (Different control panel buffers
  751. are distinguished by a numerical suffix, e.g., Ediff Control Panel<3>.)
  752.  
  753. 
  754. File: ediff.info,  Node: Selective Browsing,  Next: Highlighting Difference Regions,  Prev: Window and Frame Configuration,  Up: Customization
  755.  
  756. Selective Browsing
  757. ==================
  758.  
  759.    Sometimes it is convenient to be able to step through only some
  760. difference regions, those that satisfy certain conditions, and to
  761. ignore all others. The commands `#f' and `#h' let the user specify
  762. regular expressions to control the way Ediff skips to the next or
  763. previous difference. Typing `#f' lets one specify regular expressions
  764. for each buffer, regexp-A, regexp-B, and regexp-C.  Ediff will then
  765. start stepping through only those difference regions where the region
  766. in buffer A matches regexp-A and/or the region in buffer B matches
  767. regexp-B, etc. Whether `and' or `or' will be used depends on how the
  768. user responds to a prompt.  Similarly, using `#h', one specifies
  769. expressions that match difference regions to be ignored while stepping
  770. through the differences. That is, if the buffer A part matches
  771. regexp-A, the buffer B part matches regexp B and (if applicable)
  772. buffer-C part matches regexp-C, then the region will be ignored by the
  773. commands `n'/`SPC' (`ediff-next-difference') and `p'/`DEL'
  774. (`ediff-previous-difference') commands.
  775.  
  776.    Hitting `#f' and `#h' toggles selective browsing on/off.
  777.  
  778.    Note that selective browsing affects only `ediff-next-difference' and
  779. `ediff-previous-difference', i.e., the commands invoked by typing
  780. `n'/`SPC' and `p'/`DEL'. You can still jump directly (using `j' or
  781. `ga'/`gb'/`gc') to any numbered difference. Also, it should be
  782. understood, that `#f' and `#h' do not change the position of the point
  783. in the buffers. The effect of these commands is seen only when the user
  784. types `n' or `p', i.e., when Ediff is told to jump to the next or
  785. previous difference.
  786.  
  787.    Users can supply their own functions to specify how Ediff should do
  788. selective browsing. To change the default Ediff function, add a
  789. function to `ediff-load-hooks' which will do the following assignments:
  790.      (fset ediff-hide-regexp-matches 'your-hide-function)
  791.      (fset ediff-focus-on-regexp-matches 'your-focus-function)
  792.  
  793.    *Useful hint*: To specify a regexp that matches everything, don't
  794. simply type `RET' in response to a prompt. Typing `RET' tells Ediff to
  795. accept the default value, which may not be what you want. Instead, you
  796. should enter something like ``^'' or ``$'' -- which matches every line.
  797.  
  798.    If the user does not remember if selective browsing is in effect and
  799. which regexps are being used, the status command, `i', will supply the
  800. requisite information.
  801.  
  802.    In addition to the ability to ignore regions that match regular
  803. expressions, Ediff can be ordered to start skipping over certain
  804. `inessential' regions. This is controlled by the variable
  805. `ediff-ignore-similar-regions'
  806.      If `t', causes Ediff to skip over difference regions that deemed
  807.      inessential, i.e., where the only differences are those in the
  808.      white space and newlines.
  809.  
  810.    *Note*: In order for this feature to work, auto-refining of
  811. difference regions must be on, since otherwise Ediff won't know if
  812. there are fine differences between regions. Under X, auto-refining is a
  813. default, but it is nixed on dumb terminals or in Xterm windows.
  814. Therefore, in a non-windowing environment, the user must explicitly turn
  815. auto-refining on (e.g., by typing `@').
  816.  
  817.    *Caution*: If many inessential regions appear in a row, Ediff may
  818. take a long time to jump to the next region because it has to compute
  819. fine differences of all intermediate regions.
  820.  
  821. 
  822. File: ediff.info,  Node: Highlighting Difference Regions,  Next: Narrowing,  Prev: Selective Browsing,  Up: Customization
  823.  
  824. Highlighting Difference Regions
  825. ===============================
  826.  
  827.    The following variables control the way Ediff highlights difference
  828. regions.
  829.  
  830. `ediff-before-flag-bol'
  831. `ediff-after-flag-eol'
  832. `ediff-before-flag-mol'
  833. `ediff-after-flag-mol'
  834.      The above are ASCII strings that mark the beginning and the end of
  835.      the differences found in files A, B, and C. Ediff uses different
  836.      flags to highlight regions that begin/end at the beginning/end of
  837.      a line or in a middle of a line.
  838.  
  839. `ediff-current-diff-face-A'
  840. `ediff-current-diff-face-B'
  841. `ediff-current-diff-face-C'
  842.      Ediff uses these faces to highlight current differences on X
  843.      displays.  These and subsequently described faces can be set
  844.      either in `.emacs' or in `.Xdefaults'. The X resource for Ediff is
  845.      `Ediff', *not* `emacs'. Please refer to Emacs manual for the
  846.      information on how to set X resources.
  847.  
  848. `ediff-fine-diff-face-A'
  849. `ediff-fine-diff-face-B'
  850. `ediff-fine-diff-face-C'
  851.      Faces used to show the fine differences between the current
  852.      differences regions in buffers A, B, and C, respectively.
  853.  
  854. `ediff-even-diff-face-A'
  855. `ediff-even-diff-face-B'
  856. `ediff-even-diff-face-C'
  857. `ediff-odd-diff-face-A'
  858. `ediff-odd-diff-face-B'
  859. `ediff-odd-diff-face-C'
  860.      Non-current difference regions are displayed using these
  861.      alternating faces. The odd and the even faces are actually
  862.      identical on monochrome displays, because without colors options
  863.      are limited.  So, Ediff uses italics to highlight non-current
  864.      differences.
  865.  
  866. `ediff-highlight-all-diffs'
  867.      Indicates whether--on a window system--the user wants differences
  868.      to be marked using ASCII strings (like on a dumb terminal) or
  869.      using colors and highlighting. Normally, Ediff highlights all
  870.      differences, but the selected difference is highlighted more
  871.      visibly. One can cycle through various modes of highlighting by
  872.      hitting `h'. By default, Ediff starts in the mode where all
  873.      difference regions are highlighted. If you prefer to start in the
  874.      mode where unselected differences are not highlighted, you should
  875.      set `ediff-highlight-all-diffs' to `nil'.  Typing `h' restores
  876.      highlighting of all differences.
  877.  
  878.      Ediff lets you switch between the two modes of highlighting.  That
  879.      is, you can switch interactively from highlighting using faces to
  880.      highlighting using ASCII flags, and back.  Of course, switching has
  881.      effect only under a windowing system.  On a dumb terminal or in an
  882.      xterm window, the only available option is highlighting with ASCII
  883.      flags.
  884.  
  885. If you want to change the above variables, they must be set *before*
  886. Ediff is loaded.
  887.  
  888.    There are two ways to change the default setting for highlighting
  889. faces: either change the variables, as in
  890.      (setq ediff-current-diff-face-A 'bold-italic)
  891.    or
  892.      (setq ediff-current-diff-face-A
  893.      (copy-face 'bold-italic 'ediff-current-diff-face-A))
  894.    or modify the defaults selectively:
  895.      (add-hook 'ediff-load-hooks
  896.                (function (lambda ()
  897.                            (set-face-foreground ediff-current-diff-face-B "blue")
  898.                            (set-face-background ediff-current-diff-face-B "red")
  899.                            (make-face-italic ediff-current-diff-face-B))))
  900.  
  901.    You may also want to take a look at how the above faces are defined
  902. in the source code of Ediff.
  903.  
  904.    *Note*: it is not recommended to use `internal-get-face' (or
  905. `get-face' in XEmacs) when defining Ediff's faces, since this may cause
  906. problems when there are several frames with different font sizes.
  907. Instead, use `copy-face', `set-face-*', or `make-face-*' as shown above.
  908.  
  909. 
  910. File: ediff.info,  Node: Narrowing,  Next: Refinement of Difference Regions,  Prev: Highlighting Difference Regions,  Up: Customization
  911.  
  912. Narrowing
  913. =========
  914.  
  915.    If buffers being compared are narrowed at the time of invocation of
  916. Ediff, `ediff-buffers' will preserve the narrowing range. However, if
  917. `ediff-files' is invoked on the files visited by these buffers,
  918. narrowing will be turned off, since we assume that the user wants to
  919. compare the entire files.
  920.  
  921.    Invocation of `ediff-regions-wordwise/linewise' and
  922. `ediff-windows-wordwise/linewise' will cause Ediff to set new narrowing
  923. ranges (corresponding to the windows being compared). However, the old
  924. ranges are preserved and can be restored by typing `%'. The original
  925. ranges will be also restored on quitting Ediff.
  926.  
  927.    Two variables control the behavior of
  928. `ediff-windows-wordwise/linewise', `ediff-regions-wordwise/linewise'
  929. with respect to narrowing:
  930.  
  931. `ediff-start-narrowed'
  932.      If `t', Ediff will narrow the display to the appropriate range if
  933.      it is invoked as `ediff-windows-wordwise/linewise' or
  934.      `ediff-regions-wordwise/linewise.' If `nil', narrowing will not
  935.      take place. However, the user can still toggle narrowing on and
  936.      off by typing `%'.
  937.  
  938. `ediff-quit-widened'
  939.      Controls whether on exiting Ediff should restore the visibility
  940.      range that existed before the current invocation.
  941.  
  942. 
  943. File: ediff.info,  Node: Refinement of Difference Regions,  Next: Patch and Diff Programs,  Prev: Narrowing,  Up: Customization
  944.  
  945. Refinement of Difference Regions
  946. ================================
  947.  
  948.    Ediff has variables to control the way fine differences are
  949. highlighted. This feature give the user control over the process of
  950. refinement.  Note that refinement ignores spaces, tabs, and newlines.
  951.  
  952. `ediff-auto-refine'
  953.      The default is `on', which means that fine differences within
  954.      regions will be highlighted automatically. On a slow machine,
  955.      automatic refinement may be painful. In that case, the user can
  956.      toggle auto-refining on or off (or nix it completely) by hitting
  957.      `@'. When auto-refining is off, fine differences will be shown
  958.      only for regions for which these differences have been computed
  959.      and saved before. If auto-refining is nixed, fine differences will
  960.      not be shown at all. Hitting `*' will compute and redisplay fine
  961.      differences for the current difference region, regardless of the
  962.      status auto-refining.
  963.  
  964. `ediff-auto-refine-limit'
  965.      If auto-refining is on, this variable limits the size of the
  966.      regions to be auto-refined. This guards against the possible
  967.      slow-down that may be caused by extraordinary large difference
  968.      regions.  The user can always refine the current region by typing
  969.      `*'.
  970.  
  971. `ediff-forward-word-function'
  972.      Gives the user control over how fine differences are computed.
  973.      The value must be a lisp function that determines how the current
  974.      difference region should be split into words.
  975.  
  976.      Fine diferences are computed by first splitting the current
  977.      difference region into words and then passing this along to
  978.      `ediff-diff-program'. For the default
  979.      `ediff-forward-word-function' (which is `ediff-forward-word'), a
  980.      word is a string consisting of letters, `-', or `_'; a string of
  981.      punctuation symbols; a string of digits, or a string consisting of
  982.      symbols that are neither space, nor a letter.
  983.  
  984.      This default behavior is controlled by four variables:
  985.      `ediff-word-1', ..., `ediff-word-4'. See the on-line documentation
  986.      for these variables and for the function `ediff-forward-word' for
  987.      an explanation of how to modify these variables.
  988.  
  989.    Sometimes, when a region has too many differences between the
  990. variants, highlighting of fine differences stands in the way, especially
  991. on color displays. If that is the case, the user can type `*' with a
  992. negative prefix argument, which would unhighlight fine differences for
  993. the current region.
  994.  
  995.    To unhighlight fine differences in all `diff' regions, use the
  996. command `@'. Repeated typing of this key cycles through three different
  997. states: auto-refining, no-auto-refining, and no-highlighting of fine
  998. differences.
  999.  
  1000. 
  1001. File: ediff.info,  Node: Patch and Diff Programs,  Next: Merging and diff3,  Prev: Refinement of Difference Regions,  Up: Customization
  1002.  
  1003. Patch and Diff Programs
  1004. =======================
  1005.  
  1006.    The next group of variables determines the programs to be used for
  1007. applying patches and for computing the main difference regions (not the
  1008. fine difference regions):
  1009.  
  1010. `ediff-patch-program'
  1011. `ediff-diff-program'
  1012. `ediff-diff3-program'
  1013.      Specify the functions that produce differences and do patching.
  1014.  
  1015. `ediff-patch-options'
  1016. `ediff-diff-options'
  1017. `ediff-diff3-options'
  1018.      Specify which options to pass to the above utilities.  It is
  1019.      unlikely that you would want to change these.  However, sometimes
  1020.      you may want to tell `diff' to ignore spaces and such. Use the
  1021.      option `-w' for that.  Diff has several other useful options (type
  1022.      `man diff' to find out).  However, Ediff does not let you use the
  1023.      option `-c', as it doesn't recognize this format yet. If you need
  1024.      to save the output from `diff' in a special format, Ediff lets you
  1025.      specify "custom" `diff' format using the following two variables:
  1026.  
  1027. `ediff-custom-diff-program'
  1028.      The output generated by `ediff-custom-diff-program' (which doesn't
  1029.      even have to be a Unix-style `diff'!) is not used by Ediff. It is
  1030.      provided exclusively so that the user could save if using the
  1031.      function `ediff-save-buffer' (normally bound to `wd') and later
  1032.      refer to it.  However, Ediff is not the preferred way of producing
  1033.      `diff' output in Emacs. Unless you also intend to use Ediff for
  1034.      browsing through the diff'ed files, `M-x diff' may be a faster way
  1035.      to generate output from `diff'.
  1036.  
  1037. `ediff-custom-diff-options'
  1038.      Specifies the options to pass to `ediff-custom-diff-program'.
  1039.  
  1040. *Beware of VMS Diff*: The output from VMS Diff is not yet supported.
  1041. Instead, make sure some implementation of Unix diff, such as gnudiff,
  1042. is used.
  1043.  
  1044.